package ${packagePrefix}.domain.model.${tableName?lower_case};

import com.alibaba.cola.domain.Entity;
import lombok.Data;
import lombok.EqualsAndHashCode;
<#if hasDateFields>
import java.util.Date;
</#if>
<#if hasDecimalFields>
import java.math.BigDecimal;
</#if>

/**
 * ${entityComment}
 */
@Data
@Entity
@EqualsAndHashCode(callSuper = false)
public class ${domainObjectName} {
<#list fields as field>
    /**
     * ${field.comment}
     */
    private ${field.javaType} ${field.name};
    
</#list>
    /**
     * 检查业务规则
     */
    public void checkValid() {
        // TODO: 实现业务规则验证
    }
<#if hasStatusField>
    
    /**
     * 检查是否启用
     */
    public boolean isEnabled() {
        return status != null && status == 1;
    }
    
    /**
     * 启用
     */
    public void enable() {
        this.status = 1;
    }
    
    /**
     * 禁用
     */
    public void disable() {
        this.status = 0;
    }
</#if>
} 